<?php
/**
 * Junction_Sql_Expression_OperatorNode
 * 
 * Models an operator node in an expression tree.  The operator
 * node contains pointers to two operand nodes and an operator.
 * 
 * @author Patrick J. Mizer <patrick.mizer@gmail.com>
 */
 
using("Junction_Sql_Expression_Node");
using("Junction_Sql_Operator");
 
class Junction_Sql_Expression_OperatorNode extends Junction_Sql_Expression_Node
{
	/**
	 * Operator
	 * 
	 * @var Junction_Sql_Operator
	 */
	private $_operator;
	
	/**
	 * Left child operand node
	 * 
	 * @var Junction_Sql_Expression_Node
	 */
	private $_left;
	
	/**
	 * Right child operand node
	 * 
	 * @var Junction_Sql_Expression_Node
	 */
	private $_right;
	
	/**
	 * Junction_Sql_Expression_OperatorNode Constructor
	 * 
	 * @param Junction_Sql_Expression_OperandNode
	 * @param Junction_Sql_Operator
	 * @param Junction_Sql_Expression_OperandNode
	 */
    public function __construct(
    	Junction_Sql_Expression_Node $left,
    	Junction_Sql_Operator $operator, 
    	Junction_Sql_Expression_Node $right
    ){
    	$this->_operator  = $operator;
    	$this->_left 	= $left;
    	$this->_right 	= $right;
    }
    
	/**
	 * Get left child node
	 * 
	 * @return Junction_Sql_Expression_OperandNode
	 */
    public function getLeft()
    {
    	return $this->_left;
    } 
    
	/**
	 * Get right child node
	 * 
	 * @return Junction_Sql_Expression_OperandNode
	 */    
    public function getRight()
    {
    	return $this->_right;
    }
    
    /**
     * Get operator
     * 
     * @return Junction_Sql_Operator
     */
    public function getOperator()
    {
    	return $this->_operator;
    }
}
?>